package com.trump.baiduim.dao;

import com.trump.baiduim.model.Message;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

@Repository
public interface MessageDao {
    int deleteByPrimaryKey(Long messageId);

    int insert(Message record);

    int insertSelective(Message record);

    Message selectByPrimaryKey(Long messageId);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);
    
    List<Message> queryMessage(Message message);
    
    LinkedList<Message> queryNoSendMessage(@Param("userAccount") String messageReceiver);
    
    @Update("update message set message_status='已签收', update_time = #{time} where message_id = #{messageId}")
    void updateMessageStatus(@Param("messageId") Long messageId, @Param("time")Timestamp timestamp);
}